<template>
	<!-- 隐私设置 -->
	<view>
		<baseHead title="隐私设置" :showReturn="true" :right="false"></baseHead>
		<view class="contentbox" :style="{'height':windowHeight-50-statusBarH+'px'}">
			<view class="pinbiebox">
				<view class="tishi">
					<view>屏蔽后，此公司下的所有HR将无法通过人才推荐、搜索入口看见你。
						屏蔽后，你将不会在各个推荐入口看见此公司职位，但仍然可以在该公司主页下查看其所有职位。</view>
				</view>
				<view class="pinbieqiye">
					<view class="title">屏蔽企业</view>
					<view class="qiyename" v-for="(item,index) in qiyeData" :key="index">
						<view class="name">{{item.CorpName}}</view>
						<image src="/static/image/my/yinsishanchu.png" @click="quxiaopingbi(item)"></image>
					</view>
				</view>
			</view>
			<view class="btn" @click="addShield">
				<view>添加企业</view>
			</view>
		</view>
	</view>
</template>

<script>
	import baseHead from "@/pages/component/baseHead.vue";
	export default {
		components: {
			baseHead,
		},
		data() {
			return {
				statusBarH: '', //手机状态栏高度
				windowHeight: '', //手机屏幕高度
				qiyeData: [], //企业列表数据
				obj: {
					UserId:  uni.getStorageSync("homelist").UserInfo.UserId,
					PageIndex: 1,
					PageSize: 10
				}
			}
		},
		onShow() {
			const app = getApp()
			console.log(app.globalData.customBarH);
			this.statusBarH = app.globalData.statusBarH //状态栏高度
			this.windowHeight = app.globalData.phoneInformation.windowHeight //屏幕高度
			
			this.listData()
		},
		methods: {
			listData() {
				this.$http.huirc.corpBlockList(this.obj).then(res=>{
					console.log(res);
					if(res.Success){
						this.qiyeData=res.Result.Items
					}
				})
			},
			addShield() {
				uni.navigateTo({
					url: '/pages/views/packageB/type-jobhunting/jibenshezhi/jibenziliao/BlockingEnterprises'
				})
			},
			quxiaopingbi(item){
				console.log(item);
					this.$http.huirc.corpBlockDel(item.Id).then((res)=>{
					if(res.Success){
						this.$util.toast('操作成功')
						this.listData()
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}
</style>
<style scoped lang="scss">
	.contentbox {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 29rpx 60rpx;
		box-sizing: border-box;
		align-items: center;


		.pinbiebox {
			.tishi {
				padding: 22rpx 26rpx;
				background: rgba(52, 118, 254, 0.06);
				border-radius: 20rpx;
				opacity: 1;

				view {
					font-size: 28rpx;
					font-weight: 400;
					color: #3476FE;
				}
			}

			.pinbieqiye {
				padding: 64rpx 0;

				.title {
					font-size: 36rpx;
					font-weight: bold;
					color: #000000;
					padding-bottom: 5rpx;
				}

				.qiyename {
					display: flex;
					justify-content: space-between;
					align-items: center;
					border-bottom: 1rpx solid #E7E7E8;
					padding: 31rpx 0;

					.name {
						font-size: 28rpx;
						font-weight: bold;
						color: #000000;
					}

					image {
						width: 28rpx;
						height: 28rpx;
						padding-right: 28rpx;
					}
				}
			}
		}

		.btn {
			background: #3476FE;
			border-radius: 10rpx;
			opacity: 1;
			padding: 24rpx 252rpx;
			box-sizing: border-box;

			view {
				font-size: 30rpx;
				font-weight: 400;
				color: #FFFFFF;
			}
		}
	}
</style>